import Net from '@/components/common/data/Net.js';
import Config from '@/components/common/data/Config.js';

export default class Cart {
  static getDemo(paras) {
    let url = Config.voucherUrl;
    console.log(paras);
    return Net.get(url, paras);
  };

  // 登陆
  static login(data) {
    let url = Config.login;
    return Net.newPost(url, data);
  };

  // 是否关注公众号
  static focus() {
    let url = Config.focus;
    return Net.newPost(url);
  };

  // 获取商品详情
  static getGood(data) {
    let url = Config.getGood;
    return Net.newPost(url, data);
  };

  // 商品详情评论
  static first(data) {
    let url = Config.first;
    return Net.newPost(url, data);
  };

  // 商品详情全部评论
  static allM(data) {
    let url = Config.allM;
    return Net.newPost(url, data);
  };

  // 获取首页框架
  static getAllList() {
    let url = Config.allList;
    return Net.newPost(url);
  };

  // 获取分区商品
  static getListGoods(ids) {
    let url = Config.getListGoods;
    return Net.newPost(url, ids);
  };

  // 获取全部商品
  static getAllGoods(all) {
    let url = Config.getAllGoods;
    return Net.newPost(url, all);
  };

  // 根据首页区域id获取区域商品
  static products(id) {
    let url = Config.products;
    return Net.newPost(url, id);
  };

  // 所有分类
  static groupAll(all) {
    let url = Config.groupAll;
    return Net.newPost(url, all);
  };

  // 分类下的商品
  static product(all) {
    let url = Config.product;
    return Net.newPost(url, all);
  };

  // 添加购物车
  static cart(type, data) {
    let url = Config.cart + type;
    return Net.newPost(url, data);
  };

  // 创建订单
  static create(data) {
    let url = Config.create;
    return Net.newPost(url, data);
  };

  // 创建订单2,这是后边加的特殊商品的
  static create6(data) {
    let url = Config.create6;
    return Net.newPost(url, data);
  };

  // 获取支付方式
  static pay(data) {
    let url = Config.pay;
    return Net.newPost(url, data);
  };

  // 创建支付
  static payCreate(data) {
    let url = Config.payCreate;
    return Net.newPost(url, data);
  };

  // 获取支付凭证
  static paybase(data) {
    let url = Config.payBase;
    return Net.newPost(url, data);
  };

  // 支付成功后更新的数据
  static getData(data) {
    let url = Config.getData;
    return Net.newPost(url, data);
  };

  static price(data) {
    let url = Config.price;
    return Net.newPost(url, data);
  };

  static convert1(data) {
    let url = Config.convertOne;
    return Net.newPost(url, data);
  };

  static convert2(data) {
    let url = Config.convertSec;
    return Net.newPost(url, data);
  };
}
